package com.shzu.jwc.ty.common;

import java.util.HashMap;
import java.util.Map;

public class Msg {

	//状态码1成功 0失败
	private int code;
	//提示信息
	private String message;
	
	private Map<String,Object> data=new HashMap();
	
	public static Msg success(String ms)
	{
		Msg result= new Msg();
		result.setCode(1);
		result.setMessage(ms);
		return result;
		
	}
	public static Msg error(String ms)
	{
		Msg result= new Msg();
		result.setCode(0);
		result.setMessage(ms);
		return result;
		
	}
	
	public Msg add(String key,Object value)
	{
		this.getData().put(key, value);
		return this;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Map<String, Object> getData() {
		return data;
	}

	public void setData(Map<String, Object> data) {
		this.data = data;
	}
	
}
